﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理页面</title>
<link href="{webroot}theme/admin/css/iframe.css" rel="stylesheet" type="text/css" />
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/tips/jquery.tips.js"></script>
<script src="{webroot}lib/validator/jquery.validator.js"></script>
<script src="{webroot}lib/validator/zh_CN.js"></script>
<script src="{webroot}theme/admin/js/admin.js"></script>
<!--[if lt IE 9]>
<script src="{webroot}lib/js/html5.js"></script>
<![endif]-->
<script>
function setclose(t0)
{
	if(t0=="false"){$(".no").css("display","none")}else{$(".no").css("display","block");}
}
$(function(){
	{if not(sitedata(0,0))}$(".no").css("display","none"){else}$(".no").css("display","block");{/if}
})
</script>

</head>
<body>

<div class="layout-center">
	<div class="right_subject">当前位置：设置 > <a href="?act=sms">短信设置</a></div>
    <div class="right_body">
               
        <div class="table_form">
            <form class="formname" method="post">
                
                
                <div class="form_group">
                    <div class="form_txt">短信组件：</div>
                    <div class="form_input">
                    
                    <select name="t0" onChange="setclose(this.value)">
               <option value="false" {asp sdcms.iif(not(sitedata(0,0)),"selected","")}>关闭</option>
               <option value="true" {asp sdcms.iif(sitedata(0,0),"selected","")}>开启</option>
           </select>
                    </div>
                </div>
                
                <div class="form_group no {if not(sitedata(0,0))} dis{/if}" >
                    <div class="form_txt">用户名：</div>
                    <div class="form_input"><input type="text" name="t1" size="50" maxlength="20" class="ip" value="{sitedata(0,1)}" /></div>
                </div>
                
                
                <div class="form_group no{if not(sitedata(0,0))} dis{/if}" >
                    <div class="form_txt">通讯密钥：</div>
                    <div class="form_input"><input type="text" name="t2" size="50" maxlength="20" class="ip" value="{sitedata(0,2)}" /></div>
                </div>
                
                 <div class="form_group no{if not(sitedata(0,0))} dis{/if}">
                    <div class="form_txt">手机号码：</div>
                    <div class="form_input"><input type="text" name="t3" size="50" maxlength="20" class="ip" value="{sitedata(0,3)}" /></div>
                </div>
                

                <div class="form_group">
                    <div class="form_bnt"><input type="submit" value="保存" class="bnt_save"><input type="button" class="bnt_normal goback" value="返回"></div>
                </div>
            </form>
        </div>
    </div>
</div>

<script>
$(".formname").validator(
	{
		stopOnError:true,
        theme:'yellow_top',
		ignore:':hidden',
		beforeSubmit:function(){$("input[type='submit']").attr("disabled",true);},
		valid:function(form)
		{
			$.fn.tips({type:'loading',content:'数据提交中'});
			$.ajax(
			{
				url:"?act=smsdb",
				type:"post",
				data:$(form).serialize(),
				success:function(data){
					data=jQuery.parseJSON(data);
					var type="warn";
					if(data.status=="y"){type="ok";}
					$.fn.tips({type:type,content:data.info});
					if(data.status=="y"){setTimeout("location.href='?act=sms'",1500);}
					else
					{$("input[type='submit']").attr("disabled",false);}
					
				}
			});
		},
		invalid:function(){$("input[type='submit']").attr("disabled",false);}
	}
);
</script>

</body>
</html>